import * as React from 'react';
import { ListItemProps } from '../../types';
import ListItem from './listItem';
import './index.module.scss';

const { memo } = React;

interface ListProps {
  list: ListItemProps[];
}
function List(props: ListProps) {
  const { list } = props;
  return (
    <ul styleName="list">
      {list.map((item, index) => (
        <ListItem {...item} key={index} />
      ))}
    </ul>
  );
}

export default memo(List);
